package interfaces;

import java.util.Scanner;

public class PayTest {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);

        System.out.println("请选择你要使用的支付方式：(1)微信支付/(2)支付宝支付");
        int num = s.nextInt();
        switch ( num ){
            case 1:Pay w = new WeChat();w.WeChatPay();
                break;
            case 2:Pay a =new Alipay();a.Alipay();
                break;
            default:break;
        }

    }
}

//支付接口
interface Pay extends WeChatPay,AlipayPay{}

interface WeChatPay{
    void WeChatPay();
}

interface AlipayPay{
    void Alipay();
}

class WeChat implements Pay {
    @Override
    public void WeChatPay() {
        System.out.println("使用微信支付");
    }

    @Override
    public void Alipay() {
    }
}

class Alipay implements Pay{

    @Override
    public void WeChatPay() {
    }

    @Override
    public void Alipay() {
        System.out.println("使用支付宝支付");
    }
}
